//
//  AutoreleasePoolRuntimeTest.h
//  test_simple_project
//
//  自动释放池和运行时特性测试文件
//

#import <Foundation/Foundation.h>
#import <objc/runtime.h>

@interface AutoreleasePoolRuntimeTest : NSObject

#pragma mark - Autorelease Pool Testing

// 基本自动释放池测试
- (void)testBasicAutoreleasePool;
- (void)testNestedAutoreleasePools;
- (void)testAutoreleasePoolWithLoops;
- (void)testAutoreleasePoolPerformance;

// 内存管理测试
- (void)testMemoryManagementInPool;
- (void)testLargeObjectCreationInPool;

#pragma mark - Runtime Features Testing

// 动态类创建和销毁
- (void)testDynamicClassCreation;
- (void)testDynamicMethodAddition;
- (void)testDynamicPropertyAddition;
- (void)testMethodSwizzling;

// 关联对象测试
- (void)testAssociatedObjects;
- (void)testAssociatedObjectsLifecycle;

// 消息转发测试
- (void)testMessageForwarding;
- (void)testDynamicMethodResolution;

// KVO和KVC测试
- (void)testKeyValueObserving;
- (void)testKeyValueCoding;

// 类别运行时注册
- (void)testRuntimeCategoryRegistration;

@end

// 测试用的动态类接口（将在运行时创建）
@interface DynamicTestClass : NSObject
// 这个类将通过runtime动态创建
@end

// 消息转发测试类
@interface MessageForwardingTest : NSObject
- (void)dynamicMethod:(NSString *)parameter;
@end

// KVO测试类
@interface KVOTestObject : NSObject
@property (strong, nonatomic) NSString *observedProperty;
@property (assign, nonatomic) NSInteger numericProperty;
@property (strong, nonatomic) NSArray *arrayProperty;
@end

// 关联对象测试类别
@interface NSObject (AssociatedObjectTest)
@property (strong, nonatomic) NSString *dynamicProperty;
@property (assign, nonatomic) NSInteger dynamicInteger;
@end

// 全局常量用于关联对象
FOUNDATION_EXPORT const void *kAssociatedStringKey;
FOUNDATION_EXPORT const void *kAssociatedIntegerKey;